import HttpRequest from "@/utils/request";
import { IPosition, IPositionRows } from "./type";

// 查询列表
export function getPositions(params = {}) {
  return HttpRequest<IPositionRows>("/position", "GET", params, {
    isLoading: true,
  });
}

// 查询列表
export function getAllPosition(params = {}) {
  return HttpRequest<IPositionRows>("/position/findAll", "GET", params, {
    isLoading: true,
  });
}

// 查询某个
export function getPosition(id: number) {
  return HttpRequest<IPosition>("/position/" + id, "GET");
}

// 新增
export function addPosition(params = {}) {
  return HttpRequest("/position", "POST", params);
}

// 修改
export function updatePosition(params: any) {
  return HttpRequest("/position", "PUT", params);
}

// 删除
export function delPosition(ids: number[] = []) {
  return HttpRequest("/position", "DELETE", { ids: ids.join() });
}
